package com.example.user.service;


import com.example.user.entity.Product;
import com.example.user.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductService {


    @Autowired
    private ProductMapper productMapper;
    public List<Product> productSelectPage() {
       List<Product> productList= productMapper.productSelectPage();
       return productList;
    }

    public List<Product> searchByName(String name) {

      List<Product> productList=  productMapper.searchByName(name);
      return productList;
    }

    public List<Product> searchByCategory(String category) {
        List<Product> productList=  productMapper.searchByCategory(category);
        return productList;


    }
}
